package com.zxw.controller;

import com.aaa.entity.GDeposit;
import com.aaa.vo.Result;
import com.zxw.service.GDepositService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：zxw
 * @date ：Created in 2023/2/28 19:12
 */
@RestController
@RequestMapping("/goods/deposit")
@SuppressWarnings("all")
public class GDepositController {
    @Autowired
    private GDepositService gDepositService;

    //分页加模糊查询所有储藏方式
    @RequestMapping("/findAllDeposits")
    public Result findAllDeposits(@RequestBody GDeposit gDeposit,
                                  @RequestParam(defaultValue = "1") Integer pageCurrent,
                                  @RequestParam(defaultValue = "5") Integer pageSize){
        Result allDeposits = gDepositService.findAllDeposits(gDeposit, pageCurrent, pageSize);
        return allDeposits;
    }

    //审核储藏方式
    @RequestMapping("/update")
    public Result update(@RequestBody GDeposit gDeposit){
        return gDepositService.updateDeposit(gDeposit);
    }

    //删除储藏方式
    @RequestMapping("/delete")
    public Result delete(Integer id){
        return gDepositService.deleteDeposit(id);
    }
}
